<!DOCTYPE html>
<html class="x-admin-sm">
  
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript" src="./js/cookie.js"></script>
	
	<link href="css/bootstrap-theme.min.css" rel="stylesheet">
	<link href="css/bootstrap.min.css" rel="stylesheet">
	<script src="js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="command/Bootstrap/bootstrap-3.3.0/js/bootstrap.min.js"></script>
	<script src="command/bower_components/bootbox.min.js"></script>
	<script src="command/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
	<script src="command/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
	<script src="command/bower_components/bootstrap-table/dist/bootstrap-table.min.js"></script>
	<script src="command/bower_components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
	<script src="command/bower_components/moment/min/moment-with-locales.min.js"></script>
	
	<script src="command/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
	
	<script type="application/javascript">
		$(function(){
			/* 新增按钮事件 */
			$("#btnNew").click(function(){
				$("#divData").modal();
			});
			$("#btnxg").click(function(){
				$("#divData-1").modal();
			});
			$("#btncx").click(function(){
				$("#divData-2").modal();
			});
		});
	</script>
   <script type="text/javascript">
	   $(function() {
	   	getRole();
	   });
	   
	   /* 下拉框的内容进行数据绑定 */
	   function getRole() {
	   	$("#Username").empty();
	   	$.ajax({
	   		type: "get",
	   		url: "json/username.json",
	   		dataType: "json",
	   		success: function(data) {
	   			//1.打印接收的数据
	   			console.log(data);
	   			//2.遍历数据,获取数据当中的id及名字
	   			if (!data.flag) {
	   				//通过循环获取各个对象的值
	   				$.each(data, function(index01, value01) {
	   					//console.log("索引值："+index01+",值："+value01.rid+"；"+value01.rolename);
	   					$("#Username").append('<option value="' + value01.rid + '">' + value01.rolename + '</option>');
	   				});
	   				//$("#Username").selectpicker('refresh');
	   			}
	   		},
	   		error: function(data) {
	   
			}
	   	});
	   }
   </script>
   <script type="text/javascript">
   	   $(function() {
   	   	getKeshi();
   	   });
   	   
   	   /* 下拉框的内容进行数据绑定 */
   	   function getKeshi() {
   	   	$("#keshi").empty();
   	   	$.ajax({
   	   		type: "get",
   	   		url: "json/keshi.json",
   	   		dataType: "json",
   	   		success: function(data) {
   	   			//1.打印接收的数据
   	   			console.log(data);
   	   			//2.遍历数据,获取数据当中的id及名字
   	   			if (!data.flag) {
   	   				//通过循环获取各个对象的值
   	   				$.each(data, function(index01, value01) {
   	   					//console.log("索引值："+index01+",值："+value01.rid+"；"+value01.rolename);
   	   					$("#keshi").append('<option value="' + value01.rid + '">' + value01.rolename + '</option>');
   	   				});
   	   				//$("#keshi").selectpicker('refresh');
   	   			}
   	   		},
   	   		error: function(data) {
   	   
   			}
   	   	});
   	   }
   </script>
   <script type="text/javascript">
   	   $(function() {
   	   	getZhiwu();
   	   });
   	   
   	   /* 下拉框的内容进行数据绑定 */
   	   function getZhiwu() {
   	   	$("#zhiwu").empty();
   	   	$.ajax({
   	   		type: "get",
   	   		url: "json/zhiwu.json",
   	   		dataType: "json",
   	   		success: function(data) {
   	   			//1.打印接收的数据
   	   			console.log(data);
   	   			//2.遍历数据,获取数据当中的id及名字
   	   			if (!data.flag) {
   	   				//通过循环获取各个对象的值
   	   				$.each(data, function(index01, value01) {
   	   					//console.log("索引值："+index01+",值："+value01.rid+"；"+value01.rolename);
   	   					$("#zhiwu").append('<option value="' + value01.rid + '">' + value01.rolename + '</option>');
   	   				});
   	   				//$("#zhiwu").selectpicker('refresh');
   	   			}
   	   		},
   	   		error: function(data) {
   	   
   			}
   	   	});
   	   }
   </script>
  </head>
  
  <body>
	  
	  <!-- 新增模态框处理 -->
	  <div class="modal fade" id="divData" tabindex="-1" role="dialog" aria-labelledby="myModelLable" aria-hidden="hidden">
	  		<div class="modal-dialog">
	  			<div class="modal-content">
	  				<!-- 模态标题 -->
	  				<div class="modal-header">
	  					<button type="button" class="close" data-dismiss="modal" aria-didden="true">关闭</button>
	  					<h4 class="modal-title" id="">详细信息</h4>
	  				</div>
	  				<!-- 主体表单 -->
	  				<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">姓名</label>
	  							<input type="text" id="txtUsername" name="Datausername" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  					<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">职务</label>
	  							<input type="text" id="xingbie" name="Dataxb" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  						<div class="modal-body form-inline">
	  							<div class="form-group">
	  								<label class="control-label" for="">科室</label>
	  								<input type="text" id="xingbie" name="Dataxb" maxlength="20" class="form-control">
	  							</div>
	  						</div>	
	  				<div class="modal-footer">
	  					<button type="button" id="btnsave" class="btn btn-info">保存</button>
	  				</div>
	  			</div>
	  		</div>
	  </div>
	  </div>
	   <!-- 修改模态框处理 -->
	  <div class="modal fade" id="divData-1" tabindex="-1" role="dialog" aria-labelledby="myModelLable" aria-hidden="hidden">
	  		<div class="modal-dialog">
	  			<div class="modal-content">
	  				<!-- 模态标题 -->
	  				<div class="modal-header">
	  					<button type="button" class="close" data-dismiss="modal" aria-didden="true">关闭</button>
	  					<h4 class="modal-title" id="">详细信息</h4>
	  				</div>
	  				<!-- 主体表单 -->
	  				<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">姓  名</label>
	  							<input type="text" id="txtUsername" name="Datausername" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  					<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">职务</label>
	  							<input type="text" id="xingbie" name="Dataxb" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  					<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">科室</label>
	  							<input type="text" id="xingbie" name="Dataxb" maxlength="20" class="form-control">
	  						</div>
	  					</div>	
	  				<div class="modal-footer">
	  					<button type="button" id="btnsave" class="btn btn-info">修改</button>
	  				</div>
	  			</div>
	  		</div>
	  </div>
	  </div>
	  	 
	   <!-- 查询模态框处理 -->
	  <div class="modal fade" id="divData-2" tabindex="-1" role="dialog" aria-labelledby="myModelLable" aria-hidden="hidden">
	  		<div class="modal-dialog">
	  			<div class="modal-content">
	  				<!-- 模态标题 -->
	  				<div class="modal-header">
	  					<button type="button" class="close" data-dismiss="modal" aria-didden="true">关闭</button>
	  					<h4 class="modal-title" id="">详细信息</h4>
	  				</div>
	  				<!-- 主体表单 -->
	  				<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">姓  名</label>
	  							<input type="text" id="txtUsername" name="Datausername" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  					<div class="modal-body form-inline">
	  						<div class="form-group">
	  							<label class="control-label" for="">科室</label>
	  							<input type="text" id="xingbie" name="Dataxb" maxlength="20" class="form-control">
	  						</div>
	  					</div>
	  				<div class="modal-footer">
	  					<button type="button" id="btnsave" class="btn btn-info">查询</button>
	  				</div>
	  			</div>
	  		</div>
	  </div>
	  </div>
    <div class="x-nav">
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <form class="form-horizontal" role="form">
    		<div class="form-group">
    			<label for="xm" class="control-label col-md-1">姓名</label><!-- 创建标签 -->
    			<div class="col-md-2">
    				<select id="Username" class="form-control"></select>
    			</div>
    			<label for="ks" class="control-label col-md-1">科室</label><!-- 创建标签 -->
    			<div class="col-md-2">
    				<select id="keshi" class="form-control">
    					<!-- <option selected="科室">科室</option>
    					<option>人力资源部</option>
    					<option>财务中心</option>
    					<option>生产技术部</option>
    					<option>设备保障部</option>
    					<option>生产安全部</option> -->
    				</select>
    			</div>
    			<label for="zw" class="control-label col-md-1">职务</label><!-- 创建标签 -->
    			<div class="col-md-2">
    				<select id="zhiwu" class="form-control">
    					<!-- <option selected="职务">职务</option>
    					<option>总经理</option>
    					<option>总工程师</option>
    					<option>会计</option>
    					<option>巡检员</option>
    					<option>电路检修工</option>
    					<option>配仓员</option> -->
    				</select>
    			</div>
				<button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
      </div>
	  </form>
      <xblock>
        <button class="layui-btn" id="btnNew" type="button">新增</button>
        <button class="layui-btn  " id="btnxg" type="button" >修改</button>
        <button class="layui-btn  " id="btncx" type="button" >查询</button>
        <span class="x-right" style="line-height:40px">共有数据：88 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>人员姓名</th>
            <th>职务</th>
            <th>科室</th>
            <th>状态</th>
            <th>删除</th></tr>
        </thead>
        <tbody>
          <tr>
            <td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td>李四</td>
            <td>会计</td>
            <td>财务中心</td>
            <td class="td-status">
              <span class="layui-btn layui-btn-danger layui-btn-mini">
                                已离职
                            </span>
            <td class="td-manage">
              <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
		  <tr>
            <td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td>张明</td>
            <td>电路检修工</td>
            <td>设备保障科</td>
            <td class="td-status">
              <span class="layui-btn layui-btn-danger layui-btn-mini">
                                已离职
                            </span>
            <td class="td-manage">
              <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                <i class="layui-icon">&#xe640;</i>
              </a>
            </td>
          </tr>
		  <tr>
		    <td>
		      <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
		    </td>
		    <td>高玉莹</td>
		    <td>会计</td>
		    <td>财务中心</td>
		    <td class="td-status">
		      <span class="layui-btn layui-btn-danger layui-btn-mini">
		                        已离职
		                    </span>
		    <td class="td-manage">
		      <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
		        <i class="layui-icon">&#xe640;</i>
		      </a>
		    </td>
		  </tr>
		  <tr>
		    <td>
		      <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
		    </td>
		    <td>隋嘉祺</td>
		    <td>巡检员</td>
		    <td>安全生产科</td>
		    <td class="td-status">
		      <span class="layui-btn layui-btn-danger layui-btn-mini">
		                        已离职
		                    </span>
		    <td class="td-manage">
		      <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
		        <i class="layui-icon">&#xe640;</i>
		      </a>
		    </td>
		  </tr>
        </tbody>
      </table>
      <div class="page">
        <div>
          <a class="prev" href="">&lt;&lt;</a>
          <a class="num" href="">1</a>
          <span class="current">2</span>
          <a class="num" href="">3</a>
          <a class="num" href="">35</a>
          <a class="next" href="">&gt;&gt;</a>
        </div>
      </div>

    </div>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });


      /*用户-删除*/
      function member_del(obj,id){
          layer.confirm('确认要删除吗？',function(index){
              //发异步删除数据
              $(obj).parents("tr").remove();
              layer.msg('已删除!',{icon:1,time:1000});
          });
      }



      function delAll (argument) {

        var data = tableCheck.getData();
  
        layer.confirm('确认要恢复吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('恢复成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
      }
    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>